Year (x)

Basic and Crystal syntax.

Arguments

x is a Date value or a DateTime value.

Returns

Whole Number

Action

Year extracts the year from a date and returns it as a Number.

Typical uses

Use this function any time you need to use a year, converted to a Number, in calculations or comparisons.

Examples

The following examples are applicable to Crystal syntax:

Year({file.LAST INVOICE ON})

Returns 1989, where the last invoice date was in 1989.

If Year({file.LAST UPGRADE}) < 1988 Then

    "P.S. You are missing out on many of the benefits of our new, improved version."

Else

    ""

Prints a P.S. for those customers who last upgraded prior to 1988, and prints nothing for those customers who show a more recent upgrade.

Year(CDateTime(1996, 3, 3, 10, 33, 20))

Returns 1996.

Comments

This function is designed to work like the Visual Basic function of the same name.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com